﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category1
{
  public class MT105 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagDefinition U0007;
    private static SwiftTagSubItemDefinition U0008;
    private static SwiftTagDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;

    [Description("Sequence of Total")]
    public Tag27 SequenceOfTotal_27
    {
      get
      {
        return new Tag27((SwiftElement) this, 0, (SwiftDefinitionElement) MT105.U0002);
      }
    }

    [Description("Sequence of Total")]
    public Tag27 Tag27_SequenceOfTotal
    {
      get
      {
        return this.SequenceOfTotal_27;
      }
    }

    [Description("Transaction Reference Number")]
    public Tag20 TransactionReferenceNumber_20
    {
      get
      {
        return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT105.U0005);
      }
    }

    [Description("Transaction Reference Number")]
    public Tag20 Tag20_TransactionReferenceNumber
    {
      get
      {
        return this.TransactionReferenceNumber_20;
      }
    }

    [Description("Related Reference")]
    public Tag21 RelatedReference_21
    {
      get
      {
        return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT105.U0007);
      }
    }

    [Description("Related Reference")]
    public Tag21 Tag21_RelatedReference
    {
      get
      {
        return this.RelatedReference_21;
      }
    }

    [Description("Sub-message Type")]
    public MT105.Tag12 SubMessageType_12
    {
      get
      {
        return new MT105.Tag12((SwiftElement) this, 0, (SwiftDefinitionElement) MT105.U000E);
      }
    }

    [Description("Sub-message Type")]
    public MT105.Tag12 Tag12_SubMessageType
    {
      get
      {
        return this.SubMessageType_12;
      }
    }

    [Description("EDIFACT Message")]
    public Tag77F EDIFACTMessage_77F
    {
      get
      {
        return new Tag77F((SwiftElement) this, 0, (SwiftDefinitionElement) MT105.U0010);
      }
    }

    [Description("EDIFACT Message")]
    public Tag77F Tag77F_EDIFACTMessage
    {
      get
      {
        return this.EDIFACTMessage_77F;
      }
    }

    public MT105()
      : base(true)
    {
    }

    public MT105(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT105.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT105.MessageDefinition = new SwiftMessageDefinition("MT105", "Category 1 MT105");
      MT105.U0002 = new SwiftTagDefinition("SequenceOfTotal_27", "Sequence of Total");
      MT105.U0002.TagName = ":27:";
      MT105.U0003 = new SwiftTagSubItemDefinition("MessageNumber", "Message Number");
      MT105.U0002.Elements.Add((SwiftDefinitionElement) MT105.U0003);
      MT105.U0004 = new SwiftTagSubItemDefinition("SequenceNumber", "Sequence Number");
      MT105.U0002.Elements.Add((SwiftDefinitionElement) MT105.U0004);
      MT105.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT105.U0002);
      MT105.U0005 = new SwiftTagDefinition("TransactionReferenceNumber_20", "Transaction Reference Number");
      MT105.U0005.TagName = ":20:";
      MT105.U0006 = new SwiftTagSubItemDefinition("Reference", "Transaction Reference Number");
      MT105.U0005.Elements.Add((SwiftDefinitionElement) MT105.U0006);
      MT105.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT105.U0005);
      MT105.U0007 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT105.U0007.TagName = ":21:";
      MT105.U0008 = new SwiftTagSubItemDefinition("Reference", "");
      MT105.U0007.Elements.Add((SwiftDefinitionElement) MT105.U0008);
      MT105.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT105.U0007);
      MT105.U000E = new SwiftTagDefinition("SubMessageType_12", "Sub-message Type");
      MT105.U000E.TagName = ":12:";
      MT105.U000F = new SwiftTagSubItemDefinition("SubMessageType", "Sub-messageType");
      MT105.U000E.Elements.Add((SwiftDefinitionElement) MT105.U000F);
      MT105.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT105.U000E);
      MT105.U0010 = new SwiftTagDefinition("EDIFACTMessage_77F", "EDIFACT Message");
      MT105.U0010.TagName = ":77F:";
      MT105.U0011 = new SwiftTagSubItemDefinition("EDIFACTMessage", "EDIFACT Message");
      MT105.U0010.Elements.Add((SwiftDefinitionElement) MT105.U0011);
      MT105.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT105.U0010);
    }

    public class Tag12 : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("12", value);
        }
      }

      internal Tag12(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }
  }
}
